package com.app.qbake.base.di;

import android.support.v4.app.Fragment;

import com.app.qbake.module.login.LoginFragment;
import com.app.qbake.module.login.SplashFragment;
import com.app.qbake.module.login.di.LoginComponent;
import com.app.qbake.module.login.di.SplashComponent;
import com.app.qbake.module.mine.AddressFragment;
import com.app.qbake.module.mine.CollectGoodsListFragment;
import com.app.qbake.module.mine.FollowUserListFragment;
import com.app.qbake.module.mine.GetAlipayAccountFragment;
import com.app.qbake.module.mine.MineFragment;
import com.app.qbake.module.mine.MyGoodsListFragment;
import com.app.qbake.module.mine.OrderDetailFragment;
import com.app.qbake.module.mine.OrderListFragment;
import com.app.qbake.module.mine.ShipmentFragment;
import com.app.qbake.module.mine.UserInfoFragment;
import com.app.qbake.module.mine.VipPkgFragment;
import com.app.qbake.module.mine.WalletFragment;
import com.app.qbake.module.mine.di.AddressComponent;
import com.app.qbake.module.mine.di.CollectGoodsListComponent;
import com.app.qbake.module.mine.di.FollowUserListComponent;
import com.app.qbake.module.mine.di.GetAlipayAccountComponent;
import com.app.qbake.module.mine.di.MineComponent;
import com.app.qbake.module.mine.di.MyGoodsListComponent;
import com.app.qbake.module.mine.di.OrderDetailComponent;
import com.app.qbake.module.mine.di.OrderListComponent;
import com.app.qbake.module.mine.di.ShipmentComponent;
import com.app.qbake.module.mine.di.UserInfoComponent;
import com.app.qbake.module.mine.di.VipPkgComponent;
import com.app.qbake.module.mine.di.WalletComponent;
import com.app.qbake.module.publish.PublishGoodsFragment;
import com.app.qbake.module.publish.di.PublishGoodsComponent;
import com.app.qbake.module.square.GoodsDetailFragment;
import com.app.qbake.module.square.SelectAddressFragment;
import com.app.qbake.module.square.SellerGoodsListFragment;
import com.app.qbake.module.square.SellerVideoListFragment;
import com.app.qbake.module.square.SquareFragment;
import com.app.qbake.module.square.di.GoodsDetailComponent;
import com.app.qbake.module.square.di.SelectAddressComponent;
import com.app.qbake.module.square.di.SellerGoodsListComponent;
import com.app.qbake.module.square.di.SellerVideoListComponent;
import com.app.qbake.module.square.di.SquareComponent;
import com.app.qbake.module.video.VideoListFragment;
import com.app.qbake.module.video.di.VideoListComponent;

import dagger.Binds;
import dagger.Module;
import dagger.android.AndroidInjector;
import dagger.multibindings.IntoMap;

/**
 * Created by wind on 16/5/18.
 */
@Module(subcomponents = {
        SplashComponent.class,
        LoginComponent.class,
        SquareComponent.class,
        GoodsDetailComponent.class,
        VideoListComponent.class,
        VipPkgComponent.class,
        PublishGoodsComponent.class,
        MineComponent.class,
        UserInfoComponent.class,
        AddressComponent.class,
        WalletComponent.class,
        MyGoodsListComponent.class,
        SelectAddressComponent.class,
        GetAlipayAccountComponent.class,
        CollectGoodsListComponent.class,
        FollowUserListComponent.class,
        OrderListComponent.class,
        ShipmentComponent.class,
        OrderDetailComponent.class,
        SellerGoodsListComponent.class,
        SellerVideoListComponent.class,
})
public  abstract class AppModule {

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(LoginFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildLoginFragmentInjectorFactory(LoginComponent.Builder builder);

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(SquareFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildSquareFragmentInjectorFactory(SquareComponent.Builder builder);

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(GoodsDetailFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildGoodsDetailFragmentInjectorFactory(GoodsDetailComponent.Builder builder);

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(VideoListFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildVideoListFragmentInjectorFactory(VideoListComponent.Builder builder);

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(VipPkgFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildVipPkgFragmentInjectorFactory(VipPkgComponent.Builder builder);

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(PublishGoodsFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildPublishGoodsFragmentInjectorFactory(PublishGoodsComponent.Builder builder);

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(MineFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildMineFragmentInjectorFactory(MineComponent.Builder builder);

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(UserInfoFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildUserInfoFragmentInjectorFactory(UserInfoComponent.Builder builder);

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(SplashFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildSplashFragmentInjectorFactory(SplashComponent.Builder builder);

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(AddressFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildAddressFragmentInjectorFactory(AddressComponent.Builder builder);
   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(SelectAddressFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildSelectAddressFragmentInjectorFactory(SelectAddressComponent.Builder builder);
   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(WalletFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildWalletFragmentInjectorFactory(WalletComponent.Builder builder);

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(MyGoodsListFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildMyGoodsListFragmentInjectorFactory(MyGoodsListComponent.Builder builder);

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(GetAlipayAccountFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildGetAlipayAccountFragmenttInjectorFactory(GetAlipayAccountComponent.Builder builder);

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(CollectGoodsListFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildCollectGoodsListFragmenttInjectorFactory(CollectGoodsListComponent.Builder builder);

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(FollowUserListFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildFollowUserListFragmentInjectorFactory(FollowUserListComponent.Builder builder);


   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(OrderListFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildOrderListFragmentInjectorFactory(OrderListComponent.Builder builder);

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(ShipmentFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildShipmentFragmentInjectorFactory(ShipmentComponent.Builder builder);

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(OrderDetailFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildOrderDetailFragmentInjectorFactory(OrderDetailComponent.Builder builder);

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(SellerGoodsListFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildSellerGoodsListFragmentInjectorFactory(SellerGoodsListComponent.Builder builder);

   @Binds
   @IntoMap
   @dagger.android.support.FragmentKey(SellerVideoListFragment.class)
   abstract AndroidInjector.Factory<? extends Fragment>
   buildSellerVideoListFragmentInjectorFactory(SellerVideoListComponent.Builder builder);
}
